<h1>用户管理</h1>

<div class="row" style='margin-bottom: 5px;'>
   <div class="col-md-10">
    <%= link_to "获取分组", fetch_admin_weixin_groups_path %>
    <%= link_to "获取用户", fetch_admin_weixin_users_path %>
  </div>  
</div>

<!-- <%# binding.pry %> -->
<%= render "status" %>


<div class="row">
  <div class="col-md-10">
    <table class="table table-striped table-bordered table-hover">
      <thead>
        <tr>
          <th>昵称</th>
          <th>性别</th>
          <th>城市</th>
          <th>关注时间</th>
        </tr>
      </thead>

      <tbody>
        <% @weixin_users.each do |weixin_user| %>
          <tr>
            <td>
              <img src="<%= weixin_user.headimgurl %>" alt="..." style='max-width:40px;max-height:40px'>
              <%= weixin_user.nickname %>
            </td>
            <td>
              <%= weixin_user.show_sex %>
            </td>
            <td>
              <%= weixin_user.province %>
              <%= weixin_user.city %>
            </td>
            <td>
              <%= weixin_user.local_subscribe_time %>
            </td>
          </tr>
        <% end %>
      </tbody>
    </table>
  </div>
  <div class="col-md-2" style="border: 1px solid;" >
    <% @weixin_groups.each do |weixin_group|%>
      <p>
        <%= link_to weixin_group.name, admin_weixin_users_path(wx_id: weixin_group.id)  %>(<%= weixin_group.count %>)
      </p>
    <% end %>
  </div>
 </div> 


<%= paginate @weixin_users %>

<br>


